package com.cli.spring_session_demo.service.impl;

import com.cli.spring_session_demo.mapper.UserMapper;
import com.cli.spring_session_demo.model.User;
import com.cli.spring_session_demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author xiongmin
 * @Description //TODO
 * @Date 2020/4/2 19:08
 * @Version 1.0
 **/
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    UserMapper userMapper;

    @Override
    public User findUserByAccountAndPassword(String account, String password) {
        User user = userMapper.findUserByAccountAndPassword(account, password);
        return user;
    }

    @Override
    public User findUserByUserId(long userId) {
        User user = userMapper.findUserByUserId(userId);
        return user;
    }

    @Override
    public void save(User user) {
        userMapper.save(user);
    }
}
